summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h b/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h
index 7e377df68..003b5b253 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h
@@ -17,17 +17,29 @@ namespace PressurePlateHandler
Chunk.ForEachEntityInBox(cBoundingBox(Vector3d(0.5, 0, 0.5) + Position, 0.5, 0.5), [&](cEntity & Entity)
{
+ if (Entity.GetHealth() <= 0)
+ {
+ return false;
+ }
+
if (Entity.IsPlayer())
{
+ const auto & Player = static_cast<cPlayer &>(Entity);
+
+ if (Player.IsGameModeSpectator())
+ {
+ return false;
+ }
+
FoundPlayer = true;
}
-
- if (Entity.IsPickup())
+ else if (Entity.IsPickup())
{
const auto & Pickup = static_cast<cPickup &>(Entity);
NumberOfEntities += static_cast<size_t>(Pickup.GetItem().m_ItemCount);
return false;
}
+
NumberOfEntities++;
return false;
});